home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
asm
/
pc370_3.exe
/
lha
/
DEMOTRAP.ALC
< prev
next >
Wrap
Text File
|
1988-01-05
|
3KB
|
57 lines
TITLE 'TESTM37.ALC - TEST SVT TRAP FACILITY FOR PC/370 REL 4.2'
* PGM-ID. TESTM37.ALC
* AUTHOR. DON HIGGINS
* DATE. 01/05/88
* REMARKS. TEST NEW SVC TRAP FACILITY - SEE DOC\SYSTEM.DOC FOR MORE INFO.
* 1. SVC 37 DEFINES SVC TRAP TABLE VIA R1 (R1=0 CANCELS TRAP MODE).
* 2. SVC WITH NON-ZERO TRAP TABLE ENTRY CAUSES CURRENT PSW TO BE STORED
* IN OLD SVC INTERRUPTION PSW IN LOW VIRTUAL MEMORY X'20', SETS
* TRAP ACTIVE MODE IN PC/370 EMULATOR, AND BRANCHES TO TRAP ADDRESS.
* 3. SVC WITH ZERO TRAP TABLE ENTRY RESULTS IN REAL SVC EXECUTION.
* 3. SVC TRAP TABLE NOT USED IN TRAP ACTIVE MODE (ALL SVCS ARE REAL).
* 4. LPSW INSTRUCTION TURNS OFF TRAP ACTIVE MODE.
*
* THIS FACILITY CAN BE USED TO CODE MORE EFFICIENT PC/370 SVC SUPERVISOR SHELL.
* IT CAN BE USED DIRECTLY OR WITH PROBLEM STATE FACILITY TO REDUCE OVERHEAD
* ASSOCIATED WITH EMULATOR OF 370 SVC FIRST LEVEL INTERRUPT HANDLER. IT CAN
* BE USED TO SIMPLY ADD USER EXIT TO SELECTED PC/370 SVC'S SUCH AS I/O OPEN,
* CLOSE, ETC.
*
TESTM37 CSECT
LR R12,R15
USING TESTM37,R12
LA R2,=C'TESTM37 STARTED$'
SVC WTO
LA R1,SVCTAB
SVC SVCTRAP SET TRAP SVC TABLE (ALL 0'S)
LA R2,=C'TEST SVC 209 #1 VIA REAL - ENTRY 0$'
SVC WTO USE REAL SVC SINCE ENTRY 0
MVC SVCTAB+4*WTO,=A(WTOTRAP) SET TRAP ADDRESS IN TABLE
LA R2,=C'TEST SVC 209 #2 VIA TRAP - ENTRY NOT ZERO$'
SVC WTO USE WTOTRAP THIS TIME
SR R1,R1
SVC SVCTRAP CANCEL SVC TRAP FACILITY
LA R2,=C'TEST SVC 209 #3 VIA REAL - TRAP CANCELLED$'
SVC WTO USE REAL SVC - NOT TRAPS
LA R1,SVCTAB
SVC SVCTRAP SET TRAP ON AGAIN
LA R2,=C'TEST SVC 209 #4 VIA TRAP - TRAP BACK ON$'
SVC WTO USE TRAP AGAIN
SVC EXIT USE REAL - NO SVC 0 TRAP ENTRY
WTOTRAP EQU * ENTERED VIA SVC WTO WITH SVCTAB+4*WTO CONTAINING ENTRY
LR R3,R2 SAVE MSG ADDR FOR SVC CAUSING TRAP ENTRY
LA R2,=C'TRAP ENTERED$'
SVC WTO USE REAL - TRAP ACTIVE MODE
LR R2,R3
SVC WTO USE REAL - TRAP ACTIVE MODE
LA R2,=C'EXITING WTOTRAP NOW$'
SVC WTO USE REAL - TRAP ACTIVE MODE
USING IHAPSW,0
LPSW OLDSVC RETURN AND RESET ACTIVE MODE
LTORG
COPY CPY/EQUREGS R1-R15 EQU'S
COPY CPY/EQUSVCS PC/370 REAL SVC EQU'S
SVCTAB DC 256A(0) TABLE OF TRAP ADDRESSES FOR SVC 0-255
COPY CPY/IHAPSW IHAPSW DSECT OF LOW STORAGE PSW AREAS
END TESTM37